package com.team11.server.service.admin;
import com.team11.server.mapper.Admin_Update_T_Mapper;
import com.team11.server.pojo.TInformation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class Admin_Update_T_Service {
    @Autowired
    private Admin_Update_T_Mapper admin_update_t_mapper;
    public TInformation SelTById(Integer tId){
        return admin_update_t_mapper.Sel_T_ById(tId);
    }
    public String Sel_haveTid(TInformation tInformation){
        Integer t=admin_update_t_mapper.Sel_have_Tid(tInformation);
        if (t>0){
            return "教师工号或身份证号已存在";
        }
        else {
            return "1";
        }
    }
    public String Update_t(TInformation tInformation){
        Integer t=admin_update_t_mapper.update_t(tInformation);
        if (t>0){
            return "修改成功";
        }
        else {
            return "修改失败";
        }
    }

    public String Update_T_State(TInformation tInformation){
        Integer t=admin_update_t_mapper.Update_T_state(tInformation);
        if (t>0){
            return "停用/启用成功";

        }
        else {
            return "停用/启用失败";
        }
    }


}
